package com.example.tt.percent;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    Button btn_relative;
    Button btn_frame;
    Button btn_linear;
    Button btn_complex;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btn_relative    = (Button) findViewById(R.id.btn_relative);
        btn_frame       = (Button) findViewById(R.id.btn_frame);
        btn_linear      = (Button) findViewById(R.id.btn_linear);
        btn_complex     = (Button) findViewById(R.id.btn_complex);

        btn_frame.setOnClickListener(this);
        btn_relative.setOnClickListener(this);
        btn_linear.setOnClickListener(this);
        btn_complex.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent;
        switch (v.getId()){
            case R.id.btn_relative:
                intent = new Intent(this,PercentRelativeActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_frame:
                intent = new Intent(this,PercentFrameActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_linear:
                intent = new Intent(this,PercentLinearActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_complex:
                intent = new Intent(this,PercentComplexActivity.class);
                startActivity(intent);
                break;
            default:break;
        }
    }
}
